package com.jl.model.niuniu.enums;

/*
推注
 */
public enum PushInjection {

    type1("1",0,"无推注"),
    type2("2",5,"5倍"),
    type3("3",10,"10倍"),
    type4("4",20,"20倍"),
    type5("5",40,"40倍");

    private String id;
    private Integer value;
    private String desc;

    PushInjection(String id, Integer value, String desc) {
        this.id = id;
        this.value = value;
        this.desc = desc;
    }

    public static Integer typeStr(String desc){
        PushInjection[] values = PushInjection.values();
        for (PushInjection value : values) {
            if (desc.equals(value.getDesc())){
                return value.getValue();
            }
        }
        return null;
    }

    public static Integer getValueById(String id){
        PushInjection[] values = PushInjection.values();
        for (PushInjection value : values) {
            if (id.equals(value.getId())){
                return value.getValue();
            }
        }
        return null;
    }

    public String getId() {
        return id;
    }

    public Integer getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }
}
